//
//  OTDR_DetailCell.m
//  OTDR
//
//  Created by Liu on 2024/5/19.
//

#import "OTDR_DetailCell.h"


@implementation OTDR_DetailCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = kWhiteColor;
        [self setupUI];
    }
    return self;
}
- (void)setupUI {
    self.nameLabel = [ViewCreate createLabelFrame:CGRectMake(0, 0, SIZE(120), SIZE(35)) backgroundColor:ClearColor text:@"-：" textColor:RGB51 textAlignment:Left font:FONT(16)];
    [self.contentView addSubview:self.nameLabel];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(SIZE(20));
        make.centerY.mas_offset(0);
        make.height.mas_offset(SIZE(30));
        make.width.mas_lessThanOrEqualTo(SIZE(120));
    }];
    
    UIImageView *rightIcon = [ViewCreate createImageViewFrame:CGRectMake(0, 0, SIZE(35), SIZE(35)) image:@"arrow_black_icon"];
    [self.contentView addSubview:rightIcon];
    [rightIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_offset(0);
        make.right.mas_offset(-SIZE(20));
        make.width.mas_offset(SIZE(7.5));
        make.height.mas_offset(SIZE(11.5));
    }];
    
    self.detailInfoLabel = [ViewCreate createLabelFrame:CGRectMake(0, 0, SIZE(120), SIZE(35)) backgroundColor:ClearColor text:@"-" textColor:RGB51 textAlignment:Left font:FONT(16)];
    [self.contentView addSubview:self.detailInfoLabel];
    [self.detailInfoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(rightIcon.mas_left).mas_offset(-SIZE(8));
        make.centerY.mas_offset(0);
        make.height.mas_offset(SIZE(30));
        make.width.mas_lessThanOrEqualTo(SIZE(120));
    }];
    
    UIView *lineView = [ViewCreate createLineFrame:CGRectMake(0, 0, SCREEN_WIDTH, 1) backgroundColor:RGB211];
    [self.contentView addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_offset(0);
        make.height.mas_offset(1);
    }];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
